home *** CD-ROM | disk | FTP | other *** search
- Getting the legal stuff out of the way first...
-
- License:
-
- SYNC.EXE / SYNC.PRG Copyright 1993 SofKinetics Inc. All Rights Reserved.
-
- (1) This program is free.
-
- (2) You are free to use, copy and distribute SYNC.PRG and/or the
- compiled SYNC.EXE providing:
-
- (a) No fee is charged for use, copying or distribution.
-
- (b) You distribute the source file with original copyright
- and annotate any and all changes you make.
-
-
- SofKinetics, Inc.
- Stone Mountain, GA 30088-2125
- (404) 578-7148
-
-
- Disclaimer:
-
- SofKinetics hereby disclaims all warranties relating to this
- software, whether express or implied, including without
- limitation any implied warranties of merchantability or fitness
- for a particular purpose.
-
- SofKinetics will not be liable for any special, incidental,
- consequential, indirect or similar damages due to loss of data
- or any other reason, even if SofKinetics or an agent of SofKinetics
- has been advised of the possibility of such damages.
-
- The person using the software bears all risk as to the quality and
- performance of the software.
-
- ******************************************************************************
-
- Why SYNC?
-
- SYNC is one of those utilities that might have never been written had it
- not been for a unique need. That need, to maintain a "master" directory
- of distribution files (the target) and update the target directory as
- changes were made to files in source directories. Once updated, the
- target directory may serve as the source for another subordinate filing
- directory, the shadow. The scenario runs something like this:
-
- I have a master directory of Window drivers, .GRPs, and .INIs on my hard
- disk. These are the ones I distribute to users. Some users run the win
- apps from the network, others from the local HD since they have portable
- PCs and docking stations. I have the responsibility to keep the LAN and
- the user's directories synchronized but I do not have "total" control
- over all the network resources. Sometimes, others with privy will change
- a driver and fail to tell anyone!!! Sometimes, just installing software
- will do the same thing.
-
- SYNC will scan source files in a specified directory against a set of
- target files. The file specification may be explicit as in the case of
- SYSTEM.INI or may be specified using DOS wildcards as in the case of
- *.DRV. The source directory may be specified as S:\USERS\WIN or as
- S:\USERS\WIN and the target directory is specified in a similar manner.
- A file specification causes an update condition when the filename in the
- source directory (1) cannot be located in the target directory or when
- the specified source file is more current than the file in the target
- directory (based upon the time/date stamp.)
-
- If the TARGET file requires updating, any directory specifications made
- inf the SHADOW directory will also be updated. The shadow directory may
- be useful for accumulating the files from multiple target updates and
- then creating one update set for the user community. For example:
-
- FILENAME SOURCE_DIR TARGET_DIR SHADOW_DIR
- -------- ------------------- ------------------- ---------------------
- *.INI G:\WINUSERS C:\SUPPORT\WIN C:\SUPPORT\WIN\UPDATE
- *.DRV G:\WINUSERS\SYSTEM C:\SUPPORT\WIN\SYS C:\SUPPORT\WIN\UPDATE
- *.* S:\SYSTEM\NOVELL C:\PROTOCOL\SHELL C:\SUPPORT\NETWORK
-
- NOTE: If the TARGET and SHADOW directories are on a virtural drive,
- The source code should be modified where annotated to remove any
- references to file() IF THE SOURCE DIRECTORY IS LOCAL AND THE
- POSSIBILITY EXISTS FOR PROCESSING SYNC WHEN THE VIRTURAL DRIVE
- IS NOT ATTACHED/MAPPED. These changes will remove SYNC's feature
- of creating the target path using DOS MkDir.
-
- Other uses of sync may be to maintain synchronization of source code
- directories on the development PC. For example, I typically have two
- directories dedicated to a client when I am writing software; one for
- the version I am presently working and one for the static or previous
- version of the same software. In some situations, I have a third (and/
- or fourth that is an intermediate directory containing files that have
- been modified and tested. For example:
-
- C:\SOURCE\XYZ\NEWJOB (I make changes and test here)
- C:\SOURCE\XYZ\WORKS (Tested changes are moved here)
- C:\SOURCE\XYZ\BETA (Client is testing this version)
- C:\SOURCE\XYZ\CURVER (Client is running this production)
-
- SYNC can manage the above scenario by creating a batch file which
- can synchronize changes between NEWJOB, WORKS, and BETA. Of course,
- I generally do a backup before processing the batch file.
-
-
- ******************************************************************************
-
- To process SYNC:
-
- First compile under CLIPPER 5.2 (b or c):
- clipper SYNC /N /L
- and link using whichever linker you use...
- rtlink fi SYNC
-
- To execute, copy SYNC.EXE into a directory in your DOS path (or search
- path if on a network) and then type SYNC and press ENTER. The program
- will announce that the dictionary pointer (really the file sync.mem) is
- not located on drive C: root directory. Upon pressing ENTER, you must
- specify the full path to the SYNC database, SYNC.DBF, which HAS NOT yet
- been created. Generally, this may look something like the following:
- C:\UTIL\SYNCHRO\SYNC.DBF Press ENTER.
-
- Note: You may specify another name for the database other than SYNC.DBF
-
- The prompt "Create the database structure..." will appear. Select YES
- and then respond with YES again to edit the sync database.
-
- Supply a FILENAME, a SOURCE_DIR, and a TARGET_DIR as required fields. The
- fields SHADOW_DIR and INTERACT are optional. We already talked about the
- shadow directory and if INTERACT is set ( not recommended ) the operator
- will be required to "yea" and "nay" each file that requires updating. The
- fields LASTDATE and LASTTIME are written to by the program and reflect
- the last time that the UPDATE.BAT file was processed with the associated
- file(s) updated. It DOES NOT indicate the real time of update since the
- program never knows if the batch file is actually processed.
-
- After editing all required fields, press ESC to close the edit session
- and SYNC will begin processing. If any updates are required, a batch
- file UPDATE.BAT (default) will be created. If all files are in sync,
- then the UPDATE.BAT file WILL NOT be written. Therefore, always erase
- the batch file prior to running SYNC and test to see if it exists. If it
- exists, then call the file to do the actual copy work.
-
- ******************************************************************************
-
- There is little glamour is utilities and just posting one written in
- Clipper will probably open up untold threads relating to better ways and
- the proverbial rewrite in "C", but that's OK 'cause it all in fun and
- real programmers have thick skin and cry in private. Have at it, and
- have fun.
-
- Mickey Burnette
- SofKinetics, Inc.
-
-